image: gcc

before_script:
  - apt-get -qq update
  - apt-get -qq install make automake autoconf autoconf-archive gettext autopoint pkgconf libgtk-3-dev
  - ./bootstrap

cache:
  paths:
    - "src/*.o"
    - "src/tubeman"
    - "gtk/*.o"
    - "gtk/tubeman-gtk"
    - configure
    - makefile

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - ./configure
    - make
test:
  stage: build
  before_script:
    - apt-get -qq update
    - apt-get -qq install cppcheck
  script:
    - testing/cppcheck

dist:
  stage: deploy
  script:
    - ./configure
    - make dist
  artifacts:
    paths:
      - tubeman-*.tar.gz

package:
  stage: deploy
  script:
    - apt-get -qq install build-essential devscripts debhelper autotools-dev lintian
    - scripts/gendeb.sh
  artifacts:
    paths:
      - tubeman-*.deb
